package com.flong.spring;


import com.flong.spring.aop.MathCalculator;
import com.flong.spring.config.ConfigOfAOP;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author:liangjl
 * @Date: 2020/6/8-22:22
 * @Eamil:jilongliang@sina.com
 * @Description:
 * IOC (Inverse of Control ,控制反转）
 * DI (Dependency Injection 依赖注入）
 */
public class SpringClient2 {

    @Test
    public void test1( ) {

        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ConfigOfAOP.class);

       /* MathCalculator mathCalculator = new MathCalculator();
        mathCalculator.div(1,1);*/

        MathCalculator mathCalculator = applicationContext.getBean(MathCalculator.class);
        //mathCalculator.div(1,0);
        mathCalculator.div(1,0);

        applicationContext.close();

    }


}
